-
Notifications
You must be signed in to change notification settings - Fork 70
feat(oauth): Use keyring to store oauth token #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: wb/add-oauth-refresh-token
Are you sure you want to change the base?
Conversation
- rename keyring to store - make keyring struct src-cli and set label on secret
- Token converts expiresIn to a timestamp - Store the token with the endpoint suffix
|
This change is part of the following stack: Change managed by git-spice. |
| noToken := cfg.AccessToken == "" | ||
| endpointConflict := endpointArg != cfg.Endpoint | ||
|
|
||
| secretStore, err := keyring.Open() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you only open this if doing deviceflow. If we are not doing deviceflow don't open secret storage. IE avoid interacting with secret storage unless we actually need to.
Maybe you can add a wrapper around secretstore which lazily opens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop looking over my shoulder :P busy addressing this atm 😄
use keyring to store oauth token
add internal/keyring package to use 99designs keyring
return Token struct
store token in keyring
create token struct from TokenResponse
add basic http transport for oauth
OAuth transport and use when available in api client
Test plan